/*
 * 作者: 侯晓宇
 * 时间: 2017-01-11
 * 说明：
 * Copyright (c) 2016-2017 中研沃兮
 */
define(function(require) {

	var db = require('app/utils/DBUtils');
	var hc = require('app/utils/HttpClientUtils');
	var appInfo = require('app/AppInfo');
	var c = {};

	c.saveWH = function(w,h){
		db.kvset("winWidth",w);
		db.kvset("winHeight",h);
	}

	c.winW = function(){
		return parseInt(db.kvget('winWidth'));
	}

	c.winH = function(){
		return parseInt(db.kvget('winHeight'));
	}

	c.fetchWXloginDisplay = function(){
		var key = "wxlogin_show";
		var url = appInfo.serverbase + "/luyan/setting/"+key;
		var body = {};
		
		hc.post(url,body,function(resp){
			try{
				db.kvset("wxlogin_show",resp.result);
			}catch(e){
				db.kvset("wxlogin_show","0");
			}
		});
	}

	c.doesWXloginDisplay = function(){
		var val = db.kvget("wxlogin_show");
		return val == "1";
	}

	return c;
});
